function getURLVar(urlVarName) {
	var urlHalves = String(document.location).split('?');
	var urlVarValue = '';
	if(urlHalves[1]){var urlVars = urlHalves[1].split('&');for(i=0; i<=(urlVars.length); i++){if(urlVars[i]){var urlVarPair = urlVars[i].split('=');if (urlVarPair[0] && urlVarPair[0] == urlVarName) {urlVarValue = urlVarPair[1];}}}}
	return urlVarValue;
}
	$(document).ready(
		function(){
			var pa_id=getURLVar('pa_id');
			$.ajax({
		        url: '../../sys/com/control/ProductServices.php?action=queryProd_attrByPaId&pa_id='+pa_id,
		        type: 'get',
		        dataType: 'json',
		        success: function(data) {
		        	//alert(data);
		        	//data=jQuery.parseJSON(data);
		        	var proAttr=data[0];
		        	$("#p_name").html(proAttr.p_name);
		        	$("#count").html(proAttr.count);
		        	$("#price").html(proAttr.price);
		        	$("#sell_price").html(proAttr.sell_price);
		        	$("#logo_name").html(proAttr.logo_name);
		        	$("#logo_name_en").html(proAttr.logo_name_en);
		        	$("#pic").html("<img width='300px' height='300px' src='../../admin/product/images/"+proAttr.pic+"'/>");
		        	$("#prod_txt").html(proAttr.prod_txt);
		        	$("#attr").html(proAttr.attr);
		        	
		        	var i=proAttr.count<9?proAttr.count:9;
		        	var opt="";
		        	for(index=1;index<=i;index++)
	        		{
		        		opt+="<option value="+index+">"+index+"</option>";
	        		}
		        	
		        	$("#select").html(opt);
		        	//alert($("#p_name"));
		          },
		          error:function(data){
		        	  alert(data.responseText);
		          }
		        });
			
		}
	);